﻿using IceZero.Business;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceZero.RootNode
{
    public class BusinessNode
    {
        private DataStoreNode _dataStoreNode;

        /// <summary>
        /// 
        /// </summary>
        public CatBusiness CatBusiness { get; }

        /// <summary>
        /// 
        /// </summary>
        public ShortLinkBusiness ShortLinkBusiness { get; }
        /// <summary>
        /// 
        /// </summary>
        public TableRecordIncrementBusiness TableRecordIncrementBusiness { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ActionStatisticBusiness ActionStatisticBusiness { get; set; }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="dataStoreNode"></param>
        public BusinessNode(DataStoreNode dataStoreNode)
        {
            _dataStoreNode = dataStoreNode;
            CatBusiness = new CatBusiness(_dataStoreNode.CatDataStore);
            ShortLinkBusiness = new ShortLinkBusiness(_dataStoreNode.ShortLinkDataStore);
            TableRecordIncrementBusiness = new TableRecordIncrementBusiness(_dataStoreNode.TableRecordIncrementDataStore);
            ActionStatisticBusiness = new ActionStatisticBusiness(
                _dataStoreNode.OperationActionDataStore,
                _dataStoreNode.OperationActionComboDataStore,
                _dataStoreNode.OperationActionComboUsedDataStore,
                _dataStoreNode.OperationRecordDataStore,
                _dataStoreNode.OperationStatisticRecordDataStore);
        }
    }
}
